package com.qdu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.qdu.service.UsersService;

@Controller
public class IndexController {
    @Autowired
    private UsersService usersService;
	
    @GetMapping("/Login_index")
    public String toLogin() {
    	return "Login";
    }
    @GetMapping("/Register_index")
    public String toRegister() {
    	return "Register";
    }
    @GetMapping("/index/{Uid}")
    public String toIndex(@PathVariable String Uid,Model model) {
    	model.addAttribute("user",usersService.getUserById(Uid));
    	return "index";
    }
    

    
}
